FROM python:3.8.16-alpine3.17
# FROM alpine:3.17

ARG ALPINE_URL=mirrors.aliyun.com

RUN sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_URL}/g" /etc/apk/repositories

RUN	apk update && apk add \
    gcc \
    linux-headers \
    libc-dev \
    python3-dev \
    git \
    curl \
    openrc \
    libsodium 

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ARG PYPIH=pypi.douban.com
ARG PYPIM=https://${PYPIH}/simple/

RUN pip3 install --upgrade pip -i ${PYPIM} --trusted-host ${PYPIH} 

COPY aioweb /aioweb
# COPY ./ /aioweb

# RUN git clone https://gitee.com/shadaileng/packaging.git /aioweb

WORKDIR /aioweb/plugin/

RUN pip3 install file:///aioweb -i ${PYPIM} --trusted-host ${PYPIH}
RUN pip3 install -r plugins/v2ray/requirements.txt -i ${PYPIM} --trusted-host ${PYPIH}

CMD [ "python3", "-m", "aioweb", "--host", "0.0.0.0" ]
